package com.szosen.util;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import android.content.Context;
import android.text.TextUtils;

public class NationUtil {
	/***
	 * 输入民族名称
	 * 
	 * @param nation
	 * @return 民族代码
	 */
	public static String getNationCode(String nation) {
		if (TextUtils.isEmpty(nation)) {
			return "";
		}
		switch (nation) {
		case "汉族":
			return "01";
		case "蒙古族":
			return "02";
		case "回族":
			return "03";
		case "藏族":
			return "04";
		case "维吾尔族":
			return "05";
		case "苗族":
			return "06";
		case "彝族":
			return "07";
		case "壮族":
			return "08";
		case "布依族":
			return "09";
		case "朝鲜族族":
			return "10";
		case "满族":
			return "11";
		case "侗族":
			return "12";
		case "瑶族":
			return "13";
		case "白族":
			return "14";
		case "土家族":
			return "15";
		case "哈尼族":
			return "16";
		case "哈萨克族":
			return "17";
		case "傣族":
			return "18";
		case "黎族":
			return "19";
		case "傈僳族":
			return "20";
		case "佤族":
			return "21";
		case "畲族":
			return "22";
		case "高山族":
			return "23";
		case "拉祜族":
			return "24";
		case "水族":
			return "25";
		case "东乡族":
			return "26";
		case "纳西族":
			return "27";
		case "景颇族":
			return "28";
		case "柯尔克孜族":
			return "29";
		case "土族":
			return "30";
		case "达斡尔族":
			return "31";
		case "仫佬族":
			return "32";
		case "羌族":
			return "33";
		case "布朗族":
			return "34";
		case "撒拉族":
			return "35";
		case "毛南族":
			return "36";
		case "仡佬族":
			return "37";
		case "锡伯族":
			return "38";
		case "阿昌族":
			return "39";
		case "普米族":
			return "40";
		case "塔吉克族":
			return "41";
		case "怒族":
			return "42";
		case "乌孜别克族":
			return "43";
		case "俄罗斯族":
			return "44";
		case "鄂温克族":
			return "45";
		case "德昂族":
			return "46";
		case "保安族":
			return "47";
		case "裕固族":
			return "48";
		case "京族":
			return "49";
		case "塔塔尔族":
			return "50";
		case "独龙族":
			return "51";
		case "鄂伦春族":
			return "52";
		case "赫哲族":
			return "53";
		case "门巴族":
			return "54";
		case "珞巴族":
			return "55";
		case "基诺族":
			return "56";
		case "外国血统族":
			return "97";
		case "其他":
			return "99";
		}
		return "";
	}

	/***
	 * 通过民族码返回民族的名称
	 * 
	 * @param context
	 * @param nationCode
	 * @return
	 */
	public static String getNationStr(String nationCode) {
		if (TextUtils.isEmpty(nationCode)) {
			return "";
		}
		switch (nationCode) {
		case "01":
			return "汉族";
		case "02":
			return "蒙古族";
		case "03":
			return "回族";
		case "04":
			return "藏族";
		case "05":
			return "维吾尔族";
		case "06":
			return "苗族";
		case "07":
			return "彝族";
		case "08":
			return "壮族";
		case "09":
			return "布依族";
		case "10":
			return "朝鲜族族";
		case "11":
			return "满族";
		case "12":
			return "侗族";
		case "13":
			return "瑶族";
		case "14":
			return "白族";
		case "15":
			return "土家族";
		case "16":
			return "哈尼族";
		case "17":
			return "哈萨克族";
		case "18":
			return "傣族";
		case "19":
			return "黎族";
		case "20":
			return "傈僳族";
		case "21":
			return "佤族";
		case "22":
			return "畲族";
		case "23":
			return "高山族";
		case "24":
			return "拉祜族";
		case "25":
			return "东乡族";
		case "26":
			return "水族";
		case "27":
			return "纳西族";
		case "28":
			return "景颇族";
		case "29":
			return "柯尔克孜族";
		case "30":
			return "土族";
		case "31":
			return "达斡尔族";
		case "32":
			return "仫佬族";
		case "33":
			return "羌族";
		case "34":
			return "布朗族";
		case "35":
			return "撒拉族";
		case "36":
			return "毛南族";
		case "37":
			return "仡佬族";
		case "38":
			return "锡伯族";
		case "39":
			return "阿昌族";
		case "40":
			return "普米族";
		case "41":
			return "塔吉克族";
		case "42":
			return "怒族";
		case "43":
			return "乌孜别克族";
		case "44":
			return "俄罗斯族";
		case "45":
			return "鄂温克族";
		case "46":
			return "德昂族";
		case "47":
			return "保安族";
		case "48":
			return "裕固族";
		case "49":
			return "京族";
		case "50":
			return "塔塔尔族";
		case "51":
			return "独龙族";
		case "52":
			return "鄂伦春族";
		case "53":
			return "赫哲族";
		case "54":
			return "门巴族";
		case "55":
			return "珞巴族";
		case "56":
			return "基诺族";
		case "97":
			return "外国民族";
		case "99":
			return "其他";
		}
		return "汉族";
	}

	public static String[] getNationArray() {
		String[] result = new String[] { "汉族", "蒙古族", "回族", "藏族", "维吾尔族", "苗族",
				"彝族", "壮族", "布依族", "朝鲜族族", "满族", "侗族", "瑶族", "白族", "土家族",
				"哈尼族", "哈萨克族", "黎族", "傈僳族", "佤族", "畲族", "高山族", "拉祜族", "东乡族",
				"水族", "纳西族", "景颇族", "柯尔克孜族", "土族", "达斡尔族", "仫佬族", "羌族", "布朗族",
				"撒拉族", "毛南族", "仡佬族", "锡伯族", "阿昌族", "普米族", "塔吉克族", "怒族",
				"乌孜别克族", "俄罗斯族", "鄂温克族", "德昂族", "保安族", "裕固族", "京族", "塔塔尔族",
				"独龙族", "鄂伦春族", "赫哲族", "门巴族", "珞巴族", "基诺族", "外国民族", "其他" };
		return result;
	}
}
